/*
 * Fifo_queue.h
 *
 *  Created on: Apr 8, 2014
 *      Author: Manuel Sandoval
 */

#ifndef FIFO_QUEUE_H_
#define FIFO_QUEUE_H_


#include "typedef_OS.h"
#include "Os_TaskCfg.h"



#define QUEUESIZE       10


typedef struct queue 
{
		    Os_TaskControlBlockType   q[QUEUESIZE+1];				/* body of queue */
        u8 					              first;                      /* position of first element */
        u8 					              last;                       /* position of last element */
        u8 					              count;                      /* number of queue elements */
} queue;



boolean init_queue(queue *q);

boolean clear_queue(queue *q);

boolean enqueue(queue *q, Os_TaskControlBlockType * Task);

boolean dequeue(queue *q, Os_TaskControlBlockType * Task);

// Check if the buffer it is empty
boolean IsEmpty();




#endif /* FIFO_QUEUE_H_ */
